package com.xinqizhi.mapper;

import com.xinqizhi.entity.SysRoleMenu;
import com.xinqizhi.vo.MenuNotInRoleVo;
import com.xinqizhi.vo.RoleMenuVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysRoleMenuMapper  {
    /**
     * 通过role-id查询所关联的菜单
     * @param roleId
     * @return
     */
    List<RoleMenuVo> selectMenusByRoleId(Integer roleId);

    /**
     * 为角色批量添加关联菜单
     * @return
     */
    Integer replaceBatchData(@Param(value = "list") List<SysRoleMenu> roleMenus);

    /**
     * 批量删除角色和菜单的关联
     * @param roleMenuIds
     * @return
     */
    Integer deleteBatchData(@Param(value = "ids") Integer[] roleMenuIds);

    /**
     * 通过角色id查询该角色已经有的菜单Id
     * @param roleId
     * @return
     */
    List<Integer> selectMenuIdByRoleId(@Param(value = "roleId") Integer roleId);
}
